package cn.ibizlab.odoo.core.odoo_account.service.impl;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.math.BigInteger;
import java.util.Collection;

import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line;
import cn.ibizlab.odoo.core.odoo_account.domain.Account_analytic_line;
import cn.ibizlab.odoo.core.odoo_account.filter.Account_analytic_lineSearchContext;
import cn.ibizlab.odoo.core.odoo_account.service.IAccount_analytic_lineService;
import cn.ibizlab.odoo.util.SearchResult;
import cn.ibizlab.odoo.util.log.IBIZLog;

/**
 * 实体[分析行] 服务对象接口实现
 */
@Slf4j
@IBIZLog
@Service
public class Account_analytic_lineServiceImpl implements IAccount_analytic_lineService {

    @Autowired
    private cn.ibizlab.odoo.core.client.service.Iaccount_analytic_lineClientService account_analytic_lineClientService;

    @Override
    public void updateBatch(List<Account_analytic_line> account_analytic_lines, int batchSize) {

        //account_analytic_lineClientService.updateBatch(account_analytic_lines,batchSize) ;

    }

    @Override
    public boolean create(Account_analytic_line account_analytic_line) {
        boolean bOk = false ;
        Iaccount_analytic_line clientModel = this.convert2Model(account_analytic_line,null);
        account_analytic_lineClientService.create(clientModel) ;
        this.convert2Domain(clientModel,account_analytic_line);
        bOk = true ;

        return bOk ;
    }

    @Override
    public Account_analytic_line get(Integer id) {
        Iaccount_analytic_line clientModel = account_analytic_lineClientService.createModel();
        clientModel.setId(id);
        account_analytic_lineClientService.get(clientModel) ;
        return this.convert2Domain(clientModel,null);
    }

    @Override
    public Account_analytic_line get(Account_analytic_line account_analytic_line) {
        Account_analytic_line retaccount_analytic_line = this.get(account_analytic_line.getId()) ;
    	BeanCopier copier=BeanCopier.create(retaccount_analytic_line.getClass(), account_analytic_line.getClass(), false);
        copier.copy(retaccount_analytic_line, account_analytic_line, null);
        return account_analytic_line ;
    }

    @Override
    public void createBatch(List<Account_analytic_line> account_analytic_lines, int batchSize) {

                        //account_analytic_lineClientService.createBatch(account_analytic_lines,batchSize) ;

    }

    @Override
    public void removeBatch(Collection<? extends Serializable> idList, int batchSize) {

        //account_analytic_lineClientService.removeBatch(account_analytic_lines) ;

    }

    @Override
    public boolean remove(Integer id) {
        boolean bOk = false ;
        Iaccount_analytic_line clientModel = account_analytic_lineClientService.createModel();
        clientModel.setId(id);
        account_analytic_lineClientService.remove(clientModel) ;
        bOk = true ;
        return bOk ;
    }

    @Override
    public boolean update(Account_analytic_line account_analytic_line) {
        boolean bOk = false ;
        Iaccount_analytic_line clientModel = this.convert2Model(account_analytic_line,null);
        account_analytic_lineClientService.update(clientModel) ;
        this.convert2Domain(clientModel,account_analytic_line) ;
        bOk = true;
        return bOk ;
    }

    /**
     * 查询集合 默认查询
     */
    @Override
    public Page<Account_analytic_line> searchDefault(Account_analytic_lineSearchContext context) {
        List<Account_analytic_line> list = new ArrayList<Account_analytic_line>();
        Page<cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line> clientModelList = account_analytic_lineClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Account_analytic_line>(list, context.getPageable(), clientModelList.getTotalElements());
    }


    /**
     * 根据科目查询
     */
    @Override
    public Page<Account_analytic_line> selectByOdoo_general_account(Integer id){
        Account_analytic_lineSearchContext context = new Account_analytic_lineSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Account_analytic_line> list = new ArrayList<Account_analytic_line>();
        Page<cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line> clientModelList = account_analytic_lineClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Account_analytic_line>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据分析账户查询
     */
    @Override
    public Page<Account_analytic_line> selectByOdoo_account(Integer id){
        Account_analytic_lineSearchContext context = new Account_analytic_lineSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Account_analytic_line> list = new ArrayList<Account_analytic_line>();
        Page<cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line> clientModelList = account_analytic_lineClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Account_analytic_line>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据分析类别查询
     */
    @Override
    public Page<Account_analytic_line> selectByOdoo_group(Integer id){
        Account_analytic_lineSearchContext context = new Account_analytic_lineSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Account_analytic_line> list = new ArrayList<Account_analytic_line>();
        Page<cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line> clientModelList = account_analytic_lineClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Account_analytic_line>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据日记账项目查询
     */
    @Override
    public Page<Account_analytic_line> selectByOdoo_move(Integer id){
        Account_analytic_lineSearchContext context = new Account_analytic_lineSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Account_analytic_line> list = new ArrayList<Account_analytic_line>();
        Page<cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line> clientModelList = account_analytic_lineClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Account_analytic_line>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据产品查询
     */
    @Override
    public Page<Account_analytic_line> selectByOdoo_product(Integer id){
        Account_analytic_lineSearchContext context = new Account_analytic_lineSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Account_analytic_line> list = new ArrayList<Account_analytic_line>();
        Page<cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line> clientModelList = account_analytic_lineClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Account_analytic_line>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据公司查询
     */
    @Override
    public Page<Account_analytic_line> selectByOdoo_company(Integer id){
        Account_analytic_lineSearchContext context = new Account_analytic_lineSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Account_analytic_line> list = new ArrayList<Account_analytic_line>();
        Page<cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line> clientModelList = account_analytic_lineClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Account_analytic_line>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据币种查询
     */
    @Override
    public Page<Account_analytic_line> selectByOdoo_currency(Integer id){
        Account_analytic_lineSearchContext context = new Account_analytic_lineSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Account_analytic_line> list = new ArrayList<Account_analytic_line>();
        Page<cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line> clientModelList = account_analytic_lineClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Account_analytic_line>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据联系人查询
     */
    @Override
    public Page<Account_analytic_line> selectByOdoo_partner(Integer id){
        Account_analytic_lineSearchContext context = new Account_analytic_lineSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Account_analytic_line> list = new ArrayList<Account_analytic_line>();
        Page<cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line> clientModelList = account_analytic_lineClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Account_analytic_line>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Account_analytic_line> selectByOdoo_create(Integer id){
        Account_analytic_lineSearchContext context = new Account_analytic_lineSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Account_analytic_line> list = new ArrayList<Account_analytic_line>();
        Page<cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line> clientModelList = account_analytic_lineClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Account_analytic_line>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Account_analytic_line> selectByOdoo_user(Integer id){
        Account_analytic_lineSearchContext context = new Account_analytic_lineSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Account_analytic_line> list = new ArrayList<Account_analytic_line>();
        Page<cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line> clientModelList = account_analytic_lineClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Account_analytic_line>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Account_analytic_line> selectByOdoo_write(Integer id){
        Account_analytic_lineSearchContext context = new Account_analytic_lineSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Account_analytic_line> list = new ArrayList<Account_analytic_line>();
        Page<cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line> clientModelList = account_analytic_lineClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Account_analytic_line>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据销售订单行查询
     */
    @Override
    public Page<Account_analytic_line> selectByOdoo_so(Integer id){
        Account_analytic_lineSearchContext context = new Account_analytic_lineSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Account_analytic_line> list = new ArrayList<Account_analytic_line>();
        Page<cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line> clientModelList = account_analytic_lineClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Account_analytic_line>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据产品计量单位查询
     */
    @Override
    public Page<Account_analytic_line> selectByOdoo_product_uom(Integer id){
        Account_analytic_lineSearchContext context = new Account_analytic_lineSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Account_analytic_line> list = new ArrayList<Account_analytic_line>();
        Page<cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line> clientModelList = account_analytic_lineClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Iaccount_analytic_line clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Account_analytic_line>(list, context.getPageable(), clientModelList.getTotalElements());

    }



    public Iaccount_analytic_line convert2Model(Account_analytic_line domain , Iaccount_analytic_line model) {
        if(domain == null)
            return model ;
        if(model==null){
            model = account_analytic_lineClientService.createModel() ;
        }

         if(domain.getWrite_dateDirtyFlag())
            model.setWrite_date(domain.getWrite_date());
         if(domain.getCodeDirtyFlag())
            model.setCode(domain.getCode());
         if(domain.getUnit_amountDirtyFlag())
            model.setUnit_amount(domain.getUnit_amount());
         if(domain.getDateDirtyFlag())
            model.setDate(domain.getDate());
         if(domain.getTag_idsDirtyFlag())
            model.setTag_ids(domain.getTag_ids());
         if(domain.get__last_updateDirtyFlag())
            model.set__last_update(domain.get__last_update());
         if(domain.getDisplay_nameDirtyFlag())
            model.setDisplay_name(domain.getDisplay_name());
         if(domain.getNameDirtyFlag())
            model.setName(domain.getName());
         if(domain.getRefDirtyFlag())
            model.setRef(domain.getRef());
         if(domain.getCreate_dateDirtyFlag())
            model.setCreate_date(domain.getCreate_date());
         if(domain.getIdDirtyFlag())
            model.setId(domain.getId());
         if(domain.getAmountDirtyFlag())
            model.setAmount(domain.getAmount());
         if(domain.getAccount_id_textDirtyFlag())
            model.setAccount_id_text(domain.getAccount_id_text());
         if(domain.getMove_id_textDirtyFlag())
            model.setMove_id_text(domain.getMove_id_text());
         if(domain.getSo_line_textDirtyFlag())
            model.setSo_line_text(domain.getSo_line_text());
         if(domain.getCreate_uid_textDirtyFlag())
            model.setCreate_uid_text(domain.getCreate_uid_text());
         if(domain.getGeneral_account_id_textDirtyFlag())
            model.setGeneral_account_id_text(domain.getGeneral_account_id_text());
         if(domain.getGroup_id_textDirtyFlag())
            model.setGroup_id_text(domain.getGroup_id_text());
         if(domain.getUser_id_textDirtyFlag())
            model.setUser_id_text(domain.getUser_id_text());
         if(domain.getCompany_id_textDirtyFlag())
            model.setCompany_id_text(domain.getCompany_id_text());
         if(domain.getPartner_id_textDirtyFlag())
            model.setPartner_id_text(domain.getPartner_id_text());
         if(domain.getCurrency_id_textDirtyFlag())
            model.setCurrency_id_text(domain.getCurrency_id_text());
         if(domain.getWrite_uid_textDirtyFlag())
            model.setWrite_uid_text(domain.getWrite_uid_text());
         if(domain.getProduct_id_textDirtyFlag())
            model.setProduct_id_text(domain.getProduct_id_text());
         if(domain.getProduct_uom_id_textDirtyFlag())
            model.setProduct_uom_id_text(domain.getProduct_uom_id_text());
         if(domain.getSo_lineDirtyFlag())
            model.setSo_line(domain.getSo_line());
         if(domain.getGeneral_account_idDirtyFlag())
            model.setGeneral_account_id(domain.getGeneral_account_id());
         if(domain.getCreate_uidDirtyFlag())
            model.setCreate_uid(domain.getCreate_uid());
         if(domain.getProduct_uom_idDirtyFlag())
            model.setProduct_uom_id(domain.getProduct_uom_id());
         if(domain.getPartner_idDirtyFlag())
            model.setPartner_id(domain.getPartner_id());
         if(domain.getProduct_idDirtyFlag())
            model.setProduct_id(domain.getProduct_id());
         if(domain.getCompany_idDirtyFlag())
            model.setCompany_id(domain.getCompany_id());
         if(domain.getAccount_idDirtyFlag())
            model.setAccount_id(domain.getAccount_id());
         if(domain.getWrite_uidDirtyFlag())
            model.setWrite_uid(domain.getWrite_uid());
         if(domain.getCurrency_idDirtyFlag())
            model.setCurrency_id(domain.getCurrency_id());
         if(domain.getGroup_idDirtyFlag())
            model.setGroup_id(domain.getGroup_id());
         if(domain.getUser_idDirtyFlag())
            model.setUser_id(domain.getUser_id());
         if(domain.getMove_idDirtyFlag())
            model.setMove_id(domain.getMove_id());
        return model ;
    }

    public Account_analytic_line convert2Domain( Iaccount_analytic_line model ,Account_analytic_line domain) {
        if(model == null)
            return domain ;
        if(domain == null){
            domain = new Account_analytic_line();
        }

        if(model.getWrite_dateDirtyFlag())
            domain.setWrite_date(model.getWrite_date());
        if(model.getCodeDirtyFlag())
            domain.setCode(model.getCode());
        if(model.getUnit_amountDirtyFlag())
            domain.setUnit_amount(model.getUnit_amount());
        if(model.getDateDirtyFlag())
            domain.setDate(model.getDate());
        if(model.getTag_idsDirtyFlag())
            domain.setTag_ids(model.getTag_ids());
        if(model.get__last_updateDirtyFlag())
            domain.set__last_update(model.get__last_update());
        if(model.getDisplay_nameDirtyFlag())
            domain.setDisplay_name(model.getDisplay_name());
        if(model.getNameDirtyFlag())
            domain.setName(model.getName());
        if(model.getRefDirtyFlag())
            domain.setRef(model.getRef());
        if(model.getCreate_dateDirtyFlag())
            domain.setCreate_date(model.getCreate_date());
        if(model.getIdDirtyFlag())
            domain.setId(model.getId());
        if(model.getAmountDirtyFlag())
            domain.setAmount(model.getAmount());
        if(model.getAccount_id_textDirtyFlag())
            domain.setAccount_id_text(model.getAccount_id_text());
        if(model.getMove_id_textDirtyFlag())
            domain.setMove_id_text(model.getMove_id_text());
        if(model.getSo_line_textDirtyFlag())
            domain.setSo_line_text(model.getSo_line_text());
        if(model.getCreate_uid_textDirtyFlag())
            domain.setCreate_uid_text(model.getCreate_uid_text());
        if(model.getGeneral_account_id_textDirtyFlag())
            domain.setGeneral_account_id_text(model.getGeneral_account_id_text());
        if(model.getGroup_id_textDirtyFlag())
            domain.setGroup_id_text(model.getGroup_id_text());
        if(model.getUser_id_textDirtyFlag())
            domain.setUser_id_text(model.getUser_id_text());
        if(model.getCompany_id_textDirtyFlag())
            domain.setCompany_id_text(model.getCompany_id_text());
        if(model.getPartner_id_textDirtyFlag())
            domain.setPartner_id_text(model.getPartner_id_text());
        if(model.getCurrency_id_textDirtyFlag())
            domain.setCurrency_id_text(model.getCurrency_id_text());
        if(model.getWrite_uid_textDirtyFlag())
            domain.setWrite_uid_text(model.getWrite_uid_text());
        if(model.getProduct_id_textDirtyFlag())
            domain.setProduct_id_text(model.getProduct_id_text());
        if(model.getProduct_uom_id_textDirtyFlag())
            domain.setProduct_uom_id_text(model.getProduct_uom_id_text());
        if(model.getSo_lineDirtyFlag())
            domain.setSo_line(model.getSo_line());
        if(model.getGeneral_account_idDirtyFlag())
            domain.setGeneral_account_id(model.getGeneral_account_id());
        if(model.getCreate_uidDirtyFlag())
            domain.setCreate_uid(model.getCreate_uid());
        if(model.getProduct_uom_idDirtyFlag())
            domain.setProduct_uom_id(model.getProduct_uom_id());
        if(model.getPartner_idDirtyFlag())
            domain.setPartner_id(model.getPartner_id());
        if(model.getProduct_idDirtyFlag())
            domain.setProduct_id(model.getProduct_id());
        if(model.getCompany_idDirtyFlag())
            domain.setCompany_id(model.getCompany_id());
        if(model.getAccount_idDirtyFlag())
            domain.setAccount_id(model.getAccount_id());
        if(model.getWrite_uidDirtyFlag())
            domain.setWrite_uid(model.getWrite_uid());
        if(model.getCurrency_idDirtyFlag())
            domain.setCurrency_id(model.getCurrency_id());
        if(model.getGroup_idDirtyFlag())
            domain.setGroup_id(model.getGroup_id());
        if(model.getUser_idDirtyFlag())
            domain.setUser_id(model.getUser_id());
        if(model.getMove_idDirtyFlag())
            domain.setMove_id(model.getMove_id());
        return domain ;
    }


}
